package chpt08;

import java.io.FileInputStream;
import java.io.IOException;

public class FileInputStreamTest {

	public static void main(String[] args){
		try (FileInputStream in = new FileInputStream("test.txt")){
			int len;
			byte[] contents = new byte[1024];
			while((len=in.read(contents))!=-1) {
				String str = new String(contents,0,len,"UTF-8");
				System.out.print(str);
			}
			System.out.println();				
		}catch(IOException e) {
			e.printStackTrace();
		}		
	}
}

